//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类;

public class demo_283 {
    public demo_283() {
    }

    public static void main(String[] args) {
        int[] nums = new int[]{1, 1, 0, 3, 12};
        moveZeroes(nums);

        for(int i = 0; i < nums.length; ++i) {
            System.out.println(nums[i]);
        }

    }

    public static void moveZeroes(int[] nums) {
        if (nums.length != 1) {
            int left = 0;

            for(int i = 0; i < nums.length; ++i) {
                if (nums[i] != 0) {
                    nums[left++] = nums[i];
                }
            }

            for(int i = left; i < nums.length; ++i) {
                nums[i] = 0;
            }
        }

    }
}
